package com.itheima.vmmysql.Controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import com.itheima.vmmysql.Service.IndexService;

@Controller
public class IndexController {
    @Autowired
    private IndexService indexService;
    @GetMapping("/index")
    public String index(Model model){
        // 获取表名
        List<String> tableNames= indexService.getTableNames();
        model.addAttribute("tableNames",tableNames);
        System.out.println("主页被访问");
        return "html/index";
    }
}